<%@ page language="java" pageEncoding="UTF-8" errorPage="/ui/defaultException.jsp"%>
<%@include file="/ui/tags.jsp"%>
<script src="${cpath}/resources/portal/js/nivo-slider/jquery.nivo.slider.js" type="text/javascript"></script>
<script src="${cpath}/resources/portal/js/infinite/jquery.infinitescroll.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$.extend($.infinitescroll.prototype,{
		_showdonemsg_twitter: function infscr_showdonemsg_twitter () {
			var opts = this.options;
            opts.loading.msg.find('img').hide();
            opts.loading.msg.find('div').eq(1)
            .html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
                //return;
                $(this).parent().fadeOut(opts.loading.speed);
            });
			// user provided callback when done
			opts.errorCallback.call($(opts.contentSelector)[0],'done');
		}
	});
	$('.news-index-news-inner').infinitescroll({
	behavior: 'twitter',
    nextSelector: ".loadmore a:first", //下页对象必须是一个有href的a,只用于取path,置于navSelector内
    navSelector: ".loadmore", //当前浏览器可见底线 处于 它offettop 与它的 bufferPx之间区域 就开始加载新内容,置contentSelector外
    itemSelector: ".news-index-news-l", //注意是要加载内容进行筛选,只加载ajax返回的html中$(itemSelector)内容,contentSelector中也必须有
    pathParse: function(path, page){
        return function(curPage) {
            return '${nextPage}'+curPage;
        };
    },
    dataType: 'html', //跨域ajax
    maxPage:'${maxPage}',
    loading: {
    	finishedMsg: "<em>已经到底了</em>",
        msg: $('<div class="hotelloading-loading" id="infscr-loading"><div class="left-line"></div><div class="center-img"><img alt="正在加载中..." src="${cpath}/resources/portal/img/loading.gif" /></div><div class="right-line"></div></div>')
    }
	});
	$('#slider').nivoSlider({
        directionNav: true,
        controlNav: false,
        pauseTime: 4000
        //这里的200000 自己修改 是自动切换时间
    });
});
 </script>
